package com.controller;

import com.common.Result;
import com.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Arrays;
import java.util.List;

@RestController
public class TestController {

    @GetMapping("/test")
    public Result test(){
        return Result.suc();
    }


    @GetMapping("/test2")
    public Result test2(){
        User user = new User("admin", "admin", "1234", 18, 0,
                "12345678901", 1, "1");
        return Result.suc(user);
    }

    @GetMapping("/test3")
    public Result test3(){
        List<User> list = Arrays.asList(
                new User("admin", "admin", "1234", 18, 0,
                        "12345678901", 1, "1"),
                new User("admin", "admin", "1234", 18, 0,
                        "12345678901", 1, "1")
        );

        return Result.suc(list);
    }

}
